package com.mjp.spring;

import com.mjp.spring.learn.FactoryBeanService;
import com.mjp.spring.service.AService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public class TestSpring {
    public static void main(String[] args) {
//        ApplicationContext applicationContext = new MyClassPathXmlApplicationContext("spring.xml");
        ApplicationContext context = new AnnotationConfigApplicationContext("com.mjp.spring");
//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
//        AService u = (AService) context.getBean("AService");
//        System.out.println(u);
        FactoryBeanService factoryBeanService = context.getBean(FactoryBeanService.class);
        factoryBeanService.testFactoryBeanService();
    }
}
